import { findAllJob } from '../services/alarm-job-controller';

export default {
  namespace: 'LogModel',

  state: {
    data: [],
  },

  effects: {
    *findAllJob(_, { call, put }) {
      // 请求数据
      const data = yield call(findAllJob);
      if (!data) return;
      // 保存数据
      yield put({ type: 'save', payload: { data } });
    },
  },

  reducers: {
    save(state, { payload }) {
      return { ...state, ...payload };
    },
  },
};
